package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.AssetsLifeCycle;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/AssetsLifeCycleMapper.class */
public interface AssetsLifeCycleMapper {
    @Select({"<script>", "select a.*,d.dict_name as cycletypeName,u.name as userName from assets_life_cycle a left join dict_data d on d.dict_type = 'cycle_type' and a.cycle_type = d.dict_value  left join user u on u.id = a.user_id  <where> <if test='id != null '>assets_id = #{id,jdbcType=VARCHAR} </if></where> order by create_time asc</script>"})
    @Results({@Result(column = "assets_id", property = "assetsId", jdbcType = JdbcType.INTEGER), @Result(column = "cycle_type", property = "cycletype", jdbcType = JdbcType.INTEGER), @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.VARCHAR)})
    List<AssetsLifeCycle> findById(@Param("id") Integer num);

    @Insert({"insert into assets_life_cycle(assets_id,cycle_type,create_time,user_id) values(#{assetsId},#{cycletype},#{createTime},#{userId})"})
    Integer add(@Param("assetsId") Integer num, @Param("cycletype") Integer num2, @Param("createTime") String str, @Param("userId") Integer num3);
}